#pragma once

#include "repo_res.h"
#include "external/tinyxml/tinyxml2.h"
#include "messiah/resource/xml_util.h"

#include <map>
#include <vector>

namespace renderit
{
	namespace messiah
	{
		class repo_res_material : public repo_res
		{
		public:
			repo_res_material(repo_item * item, const std::string& dir)
				: repo_res(item, dir)
				, is_dirty_(false)
			{

			}

		public:
			void load() override;

			void save() override;

			uint32 replace_guid(const std::string& from_guid, const std::string& to_guid) override;

			std::vector<std::string> get_deps() override;

		private:
			tinyxml2::XMLDocument doc_;

			std::map<std::string, std::vector<guid_info>> xml_guid_map_;

			bool is_dirty_;
		};
	}
}